<template>
  <header class="header header-main">
    <div class="container navbar-custom">
      <div class="left">
        <router-link to="/">
          <img src="../../../assets/images/common/logo.png" alt="img" />
        </router-link>
      </div>
      <div class="right">
        <ul class="list">
          <li v-for="item in BannersData" :key="item.routerUrl">
            <router-link
              :to="item.routerUrl"
              :class="{ 'main-active': $route.path === item.routerUrl }"
            >
              {{ item.title }}
            </router-link>
          </li>
        </ul>
      </div>
    </div>
  </header>
</template>

<script>
export default {
  name: "NavMainCpn",
  props: { BannersData: Array },
  data() {
    return {};
  },
};
</script>

<style lang="less" scoped>
.header {
  z-index: 9999;
  width: 100%;
  .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    box-sizing: border-box;
    padding-right: 10px;
    padding-left: 10px;
    width: 1000px;
    height: 70px;
  }
  .navbar-custom {
    .left {
      height: 60px;
      img {
        height: 100%;
        width: auto;
      }
    }
    .right {
      .list {
        display: flex;
        .item {
          margin: 10px 15px;
          padding: 15px 0;
          box-sizing: border-box;
        }
      }
      a {
        display: block;
        margin: 10px 12px;
        padding: 12px 0px;
        color: #4f4f4f;
        letter-spacing: 4px;
        font-size: 16px;
        text-decoration: none;
        box-sizing: border-box;
      }
    }
  }
}

// 背景颜色设置
.header-main {
  background-color: #fff;
}

a:hover {
  color: #31c46c !important;
}

.main-active {
  color: #31c46c !important;
  border-bottom: 4px solid #31c46c;
}
</style>
